﻿using System.Collections.Generic;

namespace Generator.Selections.DataDictionary
{
    public class Table
    {
        public Table(string tableName, List<Column> columnList):this(tableName)
        {
            ColumnList = columnList;
        }

        public Table(string tableName)
        {
            TableName = tableName;
            EditableBusinessObject = true;
            RelationList = new List<Relation>();
        }

        private string _className;
        public string ClassName
        {
            get
            {
                if (string.IsNullOrEmpty(_className))
                {
                    _className = TableName.InitCap();
                }
                return _className;
            }
            set { _className = value; }
        }

        public string TableName { get; set; }
        public bool EditableBusinessObject { get; set; }
        public List<Column> ColumnList { get; set; }
        public List<Relation> RelationList { get; set; }
    }
}
